#ifndef PICKABLE_H
#define PICKABLE_H

#include <iostream>

#include "pickingcolormanager.h"

class Pickable{
    public:
        Pickable();

        void GenerateNewID();

        virtual void Draw(){};
        virtual void Pick(){};
        virtual void Clicked(){ std::cout<<"Pickable clicked"<<std::endl; };
        void PrintPickingColor(){ std::cout<<"["<<pickingColor[0]<<", "<<pickingColor[1]<<", "<<pickingColor[2]<<"]"<<std::endl; }
        void PrintPickingColorFloat(){ std::cout<<"["<<fRed()<<", "<<fBlue()<<", "<<fGreen()<<"]"<<std::endl; }
        void PrintID(){ std::cout<<"["<<GetID()<<"]"<<std::endl; }

        bool PickingColorIsSet(){ if(pickingColor[0]==0 && pickingColor[1]==0 && pickingColor[2]==0) return false; else return true; }

        int GetID(){ return GetPickingColorAsInt(); }

        int PCR(){ return pickingColor[0]; }
        int PCG(){ return pickingColor[1]; }
        int PCB(){ return pickingColor[2]; }

        float fRed(){ return (float)pickingColor[0]/255; }
        float fGreen(){ return (float)pickingColor[1]/255; }
        float fBlue(){ return (float)pickingColor[2]/255; }

    private:
        int GetPickingColorAsInt();
        int pickingColor[3];
};
#endif
